"discoloration around the eye from injury" c. 1600, from black (adj.) + eye (n.). Figurative sense of "injury to pride, rebuff" is by 1744; that of "bad reputation" is from 1880s.
In reference to dark eyes, often as a mark of beauty, from 1660s. Black-eyed is from 1590s of women, of peas from 1728. The black-eyed Susan as a flower (various species) so called from 1881, for its appearance. It also was the title of a poem by John Gay (1685-1732), which led to a popular mid-19c. British stage play of the same name.
All in the Downs the fleet was moored,
The streamers waving in the wind,
When black-eyed Susan came aboard,
"Oh! where shall I my true love find?
Tell me, ye jovial sailors, tell me true,
If my sweet William sails among the crew?"
[etc.]